package com.e3.sysmg.security.client;

import java.util.List;

import com.e3.sysmg.security.model.ModuleModel;
import com.e3.template.tgf.MyTGFUI;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFGridPanel;
import com.e3.template.tgf.TGFQueryDialog;
import com.e3.template.tgf.TGFSimpleFormPanel;
import com.e3.template.tgf.TGFTreePanelAsync;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
 * 界面样子：
 * @author JANTY
 *
 */
public class ModuleUI extends MyTGFUI<ModuleModel>{
	
	private ModuleRPCServiceAsync service = ModuleRPCService.Util.getInstance();

	@Override
	protected TGFSimpleFormPanel<ModuleModel> createFormPanel() {		
		return new ModuleFormPanel();
	}

	@Override
	protected TGFGridPanel<ModuleModel> createGridPanel() {
		return new ModuleGridPanel();
	}

	@Override
	protected TGFTreePanelAsync<ModuleModel> createTreePanel() {
		return new ModuleTreePanel();
	}

	@Override
	protected TGFQueryDialog<ModuleModel> createQueryDialog() {
		return new ModuleQueryDialog();
	}

	@Override
	protected TGFEditorDialog<ModuleModel> createEditorDialog() {
		return new ModuleEditorDialog();
	}

	@Override
	protected void executeDeleteService(List<ModuleModel> models,AsyncCallback<Void> callback) {
		service.deleteModules(models, callback);
	}

	@Override
	protected String getCurrentLocalName() {
		return ModuleMessages.INSTANCE.local_name();
	}

	@Override
	protected ModuleModel createModelInstance() {
		return ModuleHelper.INSTANCE.createModelInstance();
	}

	@Override
	protected String getDeletedDetailInfo(List<ModuleModel> models) {
		String msgs = super.getDeletedDetailInfo(models);
		return msgs+";"+ModuleMessages.INSTANCE.msg_delete_confirm_notice();
	}
}
